package com.mikufufu.blog.model.dto.api;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mikufufu.blog.common.constant.ArticleType;
import com.mikufufu.blog.common.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 文章查询参数
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class ArticleParam extends Query {

    @ApiModelProperty(value = "文章主键")
    private Integer id;

    /**
     * 文章标题
     */
    @ApiModelProperty(value = "文章标题")
    private String title;

    /**
     * 作者用户id
     */
    @ApiModelProperty(value = "作者用户id")
    private Integer userId;

    /**
     * 起始日期
     */
    @ApiModelProperty(value = "起始日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startDate;

    /**
     * 截止日期
     */
    @ApiModelProperty(value = "截止日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;

    /**
     * 文章分类id
     */
    @ApiModelProperty(value = "文章分类id")
    private Integer categoryId;

    @ApiModelProperty(value = "标签Id")
    private String tagIds;

    @ApiModelProperty(value = "作者名称")
    private String userName;

    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    /**
     * 文章类型（1-普通文章，2-合集）
     * {@link ArticleType}
     */
    @ApiModelProperty(value = "文章类型(1.普通文章，2.合集)")
    private Integer type;

    /**
     * 合集文章ID
     */
    @ApiModelProperty(value = "合集id")
    private Integer collectionId;
}
